<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="template/template.xhtml">
	<ui:define name="content">

		<h:form id="form">
			<p:growl id="messages" showDetail="true" />

			<p:dataTable id="userList" value="#{userController.users}" var="user"
				editable="true" rowKey="#{user.name}" selectionMode="single"
				selection="#{userController.selectedUser}">
				<f:facet name="header">
		            User List
		        </f:facet>

				<p:column headerText="User Name">
					<h:outputText value="#{user.name}" />
				</p:column>
			</p:dataTable>

			<p:toolbar>
				<p:toolbarGroup>
					<p:commandButton id="editButton" value="Edit User In Dialog"
						update=":form:editUserPanel" onclick="editUserDlg.show()" />
				</p:toolbarGroup>
			</p:toolbar>

			<p:dialog id="editUserDialog" widgetVar="editUserDlg"
				header="Edit User" width="450" height="250">
				<p:panelGrid id="editUserPanel" columns="2">
					<h:outputLabel value="User Name: *" />
					<!-- <p:inputText value="#{userController.selectedUser.name}" /> -->
					<p:outputLabel value="#{userController.selectedUser.name}" />
				</p:panelGrid>
			</p:dialog>
		</h:form>

	</ui:define>
</ui:composition>
</html>